<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::LinearSAGTrainer&lt; InputType, LabelType &gt; Class Template Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">LinearSAGTrainer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_linear_s_a_g_trainer-members.html">List of all members</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::LinearSAGTrainer&lt; InputType, LabelType &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__supervised__trainer.html">Supervised Trainers</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Stochastic Average Gradient Method for training of linear models,.  
 <a href="classshark_1_1_linear_s_a_g_trainer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_linear_s_a_g_trainer_8h_source.html">shark/Algorithms/Trainers/LinearSAGTrainer.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for shark::LinearSAGTrainer&lt; InputType, LabelType &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classshark_1_1_linear_s_a_g_trainer__inherit__graph.png" border="0" usemap="#ashark_1_1_linear_s_a_g_trainer_3_01_input_type_00_01_label_type_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="ashark_1_1_linear_s_a_g_trainer_3_01_input_type_00_01_label_type_01_4_inherit__map" id="ashark_1_1_linear_s_a_g_trainer_3_01_input_type_00_01_label_type_01_4_inherit__map">
<area shape="rect" title="Stochastic Average Gradient Method for training of linear models,." alt="" coords="241,49,410,90"/>
<area shape="rect" href="classshark_1_1_abstract_weighted_trainer.html" title="Superclass of weighted supervised learning algorithms." alt="" coords="5,5,193,61"/>
<area shape="poly" title=" " alt="" coords="209,48,241,53,240,58,208,53"/>
<area shape="rect" href="classshark_1_1_i_parameterizable.html" title="Top level interface for everything that holds parameters." alt="" coords="19,85,179,126"/>
<area shape="poly" title=" " alt="" coords="194,87,240,80,241,85,195,93"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a33d1c1faf1d83e0eac1506daa718ca04" id="r_a33d1c1faf1d83e0eac1506daa718ca04"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ad2ad0a52ecd9ac8677df6dbf403b68b4">Base::ModelType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a></td></tr>
<tr class="separator:a33d1c1faf1d83e0eac1506daa718ca04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a8809d447e593855a32e6cb3156a64" id="r_aa6a8809d447e593855a32e6cb3156a64"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ab6d74ebe9e01f9eefb70f9eb12738ffe">Base::WeightedDatasetType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa6a8809d447e593855a32e6cb3156a64">WeightedDatasetType</a></td></tr>
<tr class="separator:aa6a8809d447e593855a32e6cb3156a64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaabdd7fe303dcafb9ec99ffd993286c3" id="r_aaabdd7fe303dcafb9ec99ffd993286c3"><td class="memItemLeft" align="right" valign="top">typedef detail::LinearSAGTrainerBase&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::LossType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aaabdd7fe303dcafb9ec99ffd993286c3">LossType</a></td></tr>
<tr class="separator:aaabdd7fe303dcafb9ec99ffd993286c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_types_classshark_1_1_abstract_weighted_trainer"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classshark_1_1_abstract_weighted_trainer')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classshark_1_1_abstract_weighted_trainer.html">shark::AbstractWeightedTrainer&lt; Model, LabelTypeT &gt;</a></td></tr>
<tr class="memitem:ad2ad0a52ecd9ac8677df6dbf403b68b4 inherit pub_types_classshark_1_1_abstract_weighted_trainer" id="r_ad2ad0a52ecd9ac8677df6dbf403b68b4"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_trainer.html#a0d5c9d35b614d6a33e4e8bfeaf1e9298">base_type::ModelType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ad2ad0a52ecd9ac8677df6dbf403b68b4">ModelType</a></td></tr>
<tr class="separator:ad2ad0a52ecd9ac8677df6dbf403b68b4 inherit pub_types_classshark_1_1_abstract_weighted_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11e51b154b87ed5e33b6ce2c830cd3d6 inherit pub_types_classshark_1_1_abstract_weighted_trainer" id="r_a11e51b154b87ed5e33b6ce2c830cd3d6"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_trainer.html#a0cfa7cdd27b8bb162e64188095f8fa71">base_type::InputType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a></td></tr>
<tr class="separator:a11e51b154b87ed5e33b6ce2c830cd3d6 inherit pub_types_classshark_1_1_abstract_weighted_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cc4b95c06687c88b75ea8db8187336d inherit pub_types_classshark_1_1_abstract_weighted_trainer" id="r_a8cc4b95c06687c88b75ea8db8187336d"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_trainer.html#aa4e344106831fb8227c2120681588ea9">base_type::LabelType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a></td></tr>
<tr class="separator:a8cc4b95c06687c88b75ea8db8187336d inherit pub_types_classshark_1_1_abstract_weighted_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c8370c0d2c2550a50df4d6b0bccf42b inherit pub_types_classshark_1_1_abstract_weighted_trainer" id="r_a8c8370c0d2c2550a50df4d6b0bccf42b"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_abstract_trainer.html#aa4730fe9d59622d35d95cd4233f8d7af">base_type::DatasetType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8c8370c0d2c2550a50df4d6b0bccf42b">DatasetType</a></td></tr>
<tr class="separator:a8c8370c0d2c2550a50df4d6b0bccf42b inherit pub_types_classshark_1_1_abstract_weighted_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6d74ebe9e01f9eefb70f9eb12738ffe inherit pub_types_classshark_1_1_abstract_weighted_trainer" id="r_ab6d74ebe9e01f9eefb70f9eb12738ffe"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_weighted_labeled_data.html">WeightedLabeledData</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ab6d74ebe9e01f9eefb70f9eb12738ffe">WeightedDatasetType</a></td></tr>
<tr class="separator:ab6d74ebe9e01f9eefb70f9eb12738ffe inherit pub_types_classshark_1_1_abstract_weighted_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_types_classshark_1_1_abstract_trainer"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classshark_1_1_abstract_trainer')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classshark_1_1_abstract_trainer.html">shark::AbstractTrainer&lt; Model, LabelTypeT &gt;</a></td></tr>
<tr class="memitem:a0d5c9d35b614d6a33e4e8bfeaf1e9298 inherit pub_types_classshark_1_1_abstract_trainer" id="r_a0d5c9d35b614d6a33e4e8bfeaf1e9298"><td class="memItemLeft" align="right" valign="top">typedef Model&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#a0d5c9d35b614d6a33e4e8bfeaf1e9298">ModelType</a></td></tr>
<tr class="separator:a0d5c9d35b614d6a33e4e8bfeaf1e9298 inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cfa7cdd27b8bb162e64188095f8fa71 inherit pub_types_classshark_1_1_abstract_trainer" id="r_a0cfa7cdd27b8bb162e64188095f8fa71"><td class="memItemLeft" align="right" valign="top">typedef ModelType::InputType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#a0cfa7cdd27b8bb162e64188095f8fa71">InputType</a></td></tr>
<tr class="separator:a0cfa7cdd27b8bb162e64188095f8fa71 inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4e344106831fb8227c2120681588ea9 inherit pub_types_classshark_1_1_abstract_trainer" id="r_aa4e344106831fb8227c2120681588ea9"><td class="memItemLeft" align="right" valign="top">typedef LabelTypeT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#aa4e344106831fb8227c2120681588ea9">LabelType</a></td></tr>
<tr class="separator:aa4e344106831fb8227c2120681588ea9 inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4730fe9d59622d35d95cd4233f8d7af inherit pub_types_classshark_1_1_abstract_trainer" id="r_aa4730fe9d59622d35d95cd4233f8d7af"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="classshark_1_1_abstract_trainer.html#a0cfa7cdd27b8bb162e64188095f8fa71">InputType</a>, <a class="el" href="classshark_1_1_abstract_trainer.html#aa4e344106831fb8227c2120681588ea9">LabelType</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_abstract_trainer.html#aa4730fe9d59622d35d95cd4233f8d7af">DatasetType</a></td></tr>
<tr class="separator:aa4730fe9d59622d35d95cd4233f8d7af inherit pub_types_classshark_1_1_abstract_trainer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_types_classshark_1_1_i_parameterizable"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classshark_1_1_i_parameterizable')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classshark_1_1_i_parameterizable.html">shark::IParameterizable&lt; VectorType &gt;</a></td></tr>
<tr class="memitem:a2ad5e2e60b2b352988b41f46024d790b inherit pub_types_classshark_1_1_i_parameterizable" id="r_a2ad5e2e60b2b352988b41f46024d790b"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="_c_svm_linear_8cpp.html#ab106d665148183a2dc94dcf8716c9203">VectorType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_parameterizable.html#a2ad5e2e60b2b352988b41f46024d790b">ParameterVectorType</a></td></tr>
<tr class="separator:a2ad5e2e60b2b352988b41f46024d790b inherit pub_types_classshark_1_1_i_parameterizable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a160c3456f148c696d13aee3a0dcca402" id="r_a160c3456f148c696d13aee3a0dcca402"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a160c3456f148c696d13aee3a0dcca402">LinearSAGTrainer</a> (<a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aaabdd7fe303dcafb9ec99ffd993286c3">LossType</a> const *loss, double <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa9cfa27f5a150ef3a701ee208961a838">lambda</a>=0, bool offset=true)</td></tr>
<tr class="memdesc:a160c3456f148c696d13aee3a0dcca402"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <br /></td></tr>
<tr class="separator:a160c3456f148c696d13aee3a0dcca402"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14d282d2649ff7d489730833f147b2d3" id="r_a14d282d2649ff7d489730833f147b2d3"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a14d282d2649ff7d489730833f147b2d3">name</a> () const</td></tr>
<tr class="memdesc:a14d282d2649ff7d489730833f147b2d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">From <a class="el" href="classshark_1_1_i_nameable.html" title="This class is an interface for all objects which can have a name.">INameable</a>: return the class name.  <br /></td></tr>
<tr class="separator:a14d282d2649ff7d489730833f147b2d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6de6309b709e74361bce1b2ab83f47c6" id="r_a6de6309b709e74361bce1b2ab83f47c6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a6de6309b709e74361bce1b2ab83f47c6">train</a> (<a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a> &amp;model, <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa6a8809d447e593855a32e6cb3156a64">WeightedDatasetType</a> const &amp;dataset)</td></tr>
<tr class="memdesc:a6de6309b709e74361bce1b2ab83f47c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes the algorithm and trains a model on the given weighted data.  <br /></td></tr>
<tr class="separator:a6de6309b709e74361bce1b2ab83f47c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e95ff06c2b294528f1d2ef394943142" id="r_a1e95ff06c2b294528f1d2ef394943142"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a1e95ff06c2b294528f1d2ef394943142">epochs</a> () const</td></tr>
<tr class="memdesc:a1e95ff06c2b294528f1d2ef394943142"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of training epochs. A value of 0 indicates that the default of max(10, dimensionOfData) should be used.  <br /></td></tr>
<tr class="separator:a1e95ff06c2b294528f1d2ef394943142"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadca064196d92cac8b8f23f210ce89c9" id="r_aadca064196d92cac8b8f23f210ce89c9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aadca064196d92cac8b8f23f210ce89c9">setEpochs</a> (std::size_t value)</td></tr>
<tr class="memdesc:aadca064196d92cac8b8f23f210ce89c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the number of training epochs. A value of 0 indicates that the default of max(10, dimensionOfData) should be used.  <br /></td></tr>
<tr class="separator:aadca064196d92cac8b8f23f210ce89c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9cfa27f5a150ef3a701ee208961a838" id="r_aa9cfa27f5a150ef3a701ee208961a838"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa9cfa27f5a150ef3a701ee208961a838">lambda</a> () const</td></tr>
<tr class="memdesc:aa9cfa27f5a150ef3a701ee208961a838"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the value of the regularization parameter lambda.  <br /></td></tr>
<tr class="separator:aa9cfa27f5a150ef3a701ee208961a838"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3f3baaf33ba5056acf4799b017ea806" id="r_ac3f3baaf33ba5056acf4799b017ea806"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#ac3f3baaf33ba5056acf4799b017ea806">setLambda</a> (double <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa9cfa27f5a150ef3a701ee208961a838">lambda</a>)</td></tr>
<tr class="memdesc:ac3f3baaf33ba5056acf4799b017ea806"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value of the regularization parameter lambda.  <br /></td></tr>
<tr class="separator:ac3f3baaf33ba5056acf4799b017ea806"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68fcdf51001257ed05a67d42d2671c10" id="r_a68fcdf51001257ed05a67d42d2671c10"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a68fcdf51001257ed05a67d42d2671c10">trainOffset</a> () const</td></tr>
<tr class="memdesc:a68fcdf51001257ed05a67d42d2671c10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether the model to be trained should include an offset term.  <br /></td></tr>
<tr class="separator:a68fcdf51001257ed05a67d42d2671c10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cbb50a1b75f57c7dc0fe89eb28b159b" id="r_a5cbb50a1b75f57c7dc0fe89eb28b159b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a5cbb50a1b75f57c7dc0fe89eb28b159b">setTrainOffset</a> (bool offset)</td></tr>
<tr class="memdesc:a5cbb50a1b75f57c7dc0fe89eb28b159b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets whether the model to be trained should include an offset term.  <br /></td></tr>
<tr class="separator:a5cbb50a1b75f57c7dc0fe89eb28b159b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2f194a2bf0013a85e567c3802391837" id="r_aa2f194a2bf0013a85e567c3802391837"><td class="memItemLeft" align="right" valign="top">RealVector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa2f194a2bf0013a85e567c3802391837">parameterVector</a> () const</td></tr>
<tr class="memdesc:aa2f194a2bf0013a85e567c3802391837"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the vector of hyper-parameters(same as lambda)  <br /></td></tr>
<tr class="separator:aa2f194a2bf0013a85e567c3802391837"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebbf0decaa38e3fc73a13221ec3f4a9b" id="r_aebbf0decaa38e3fc73a13221ec3f4a9b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aebbf0decaa38e3fc73a13221ec3f4a9b">setParameterVector</a> (RealVector const &amp;newParameters)</td></tr>
<tr class="memdesc:aebbf0decaa38e3fc73a13221ec3f4a9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the vector of hyper-parameters(same as lambda)  <br /></td></tr>
<tr class="separator:aebbf0decaa38e3fc73a13221ec3f4a9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa424454e6433505b2ecb93c223ae43bf" id="r_aa424454e6433505b2ecb93c223ae43bf"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa424454e6433505b2ecb93c223ae43bf">numberOfParameters</a> () const</td></tr>
<tr class="memdesc:aa424454e6433505b2ecb93c223ae43bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of hyper-parameters.  <br /></td></tr>
<tr class="separator:aa424454e6433505b2ecb93c223ae43bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad35ae0b236c45b73f749285a54288e89" id="r_ad35ae0b236c45b73f749285a54288e89"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#ad35ae0b236c45b73f749285a54288e89">train</a> (<a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a> &amp;model, <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa6a8809d447e593855a32e6cb3156a64">WeightedDatasetType</a> const &amp;dataset)=0</td></tr>
<tr class="memdesc:ad35ae0b236c45b73f749285a54288e89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes the algorithm and trains a model on the given weighted data.  <br /></td></tr>
<tr class="separator:ad35ae0b236c45b73f749285a54288e89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e5711480e4f1e214ff3c30a9604d10a" id="r_a9e5711480e4f1e214ff3c30a9604d10a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a9e5711480e4f1e214ff3c30a9604d10a">train</a> (<a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a> &amp;model, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8c8370c0d2c2550a50df4d6b0bccf42b">DatasetType</a> const &amp;dataset)</td></tr>
<tr class="memdesc:a9e5711480e4f1e214ff3c30a9604d10a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes the algorithm and trains a model on the given unweighted data.  <br /></td></tr>
<tr class="separator:a9e5711480e4f1e214ff3c30a9604d10a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_i_nameable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_i_nameable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_i_nameable.html">shark::INameable</a></td></tr>
<tr class="memitem:a877dbdfc6b58ea836495143cea44a98c inherit pub_methods_classshark_1_1_i_nameable" id="r_a877dbdfc6b58ea836495143cea44a98c"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_nameable.html#a877dbdfc6b58ea836495143cea44a98c">~INameable</a> ()</td></tr>
<tr class="separator:a877dbdfc6b58ea836495143cea44a98c inherit pub_methods_classshark_1_1_i_nameable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_i_serializable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_i_serializable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_i_serializable.html">shark::ISerializable</a></td></tr>
<tr class="memitem:a7baa9ce108d7278822297ce15882782a inherit pub_methods_classshark_1_1_i_serializable" id="r_a7baa9ce108d7278822297ce15882782a"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a7baa9ce108d7278822297ce15882782a">~ISerializable</a> ()</td></tr>
<tr class="memdesc:a7baa9ce108d7278822297ce15882782a inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual d'tor.  <br /></td></tr>
<tr class="separator:a7baa9ce108d7278822297ce15882782a inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4ad9a7c274deff642f91e98417fbc63 inherit pub_methods_classshark_1_1_i_serializable" id="r_ad4ad9a7c274deff642f91e98417fbc63"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#ad4ad9a7c274deff642f91e98417fbc63">read</a> (<a class="el" href="namespaceshark.html#ada68729491840669e47c8ad42282424f">InArchive</a> &amp;archive)</td></tr>
<tr class="memdesc:ad4ad9a7c274deff642f91e98417fbc63 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the component from the supplied archive.  <br /></td></tr>
<tr class="separator:ad4ad9a7c274deff642f91e98417fbc63 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bddedd42933c922e323b73131f62f12 inherit pub_methods_classshark_1_1_i_serializable" id="r_a9bddedd42933c922e323b73131f62f12"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a9bddedd42933c922e323b73131f62f12">write</a> (<a class="el" href="namespaceshark.html#af4f8eb8e9618f5236b71bbcb12b8a524">OutArchive</a> &amp;archive) const</td></tr>
<tr class="memdesc:a9bddedd42933c922e323b73131f62f12 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the component to the supplied archive.  <br /></td></tr>
<tr class="separator:a9bddedd42933c922e323b73131f62f12 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdda0c5b8e065b8afbac2cba8f58e841 inherit pub_methods_classshark_1_1_i_serializable" id="r_abdda0c5b8e065b8afbac2cba8f58e841"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#abdda0c5b8e065b8afbac2cba8f58e841">load</a> (<a class="el" href="namespaceshark.html#ada68729491840669e47c8ad42282424f">InArchive</a> &amp;archive, unsigned int version)</td></tr>
<tr class="memdesc:abdda0c5b8e065b8afbac2cba8f58e841 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Versioned loading of components, calls read(...).  <br /></td></tr>
<tr class="separator:abdda0c5b8e065b8afbac2cba8f58e841 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bf66fa8db15cc529bec98976a2f5255 inherit pub_methods_classshark_1_1_i_serializable" id="r_a5bf66fa8db15cc529bec98976a2f5255"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a5bf66fa8db15cc529bec98976a2f5255">save</a> (<a class="el" href="namespaceshark.html#af4f8eb8e9618f5236b71bbcb12b8a524">OutArchive</a> &amp;archive, unsigned int version) const</td></tr>
<tr class="memdesc:a5bf66fa8db15cc529bec98976a2f5255 inherit pub_methods_classshark_1_1_i_serializable"><td class="mdescLeft">&#160;</td><td class="mdescRight">Versioned storing of components, calls write(...).  <br /></td></tr>
<tr class="separator:a5bf66fa8db15cc529bec98976a2f5255 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4560a94e8f4908fe8627e41e7d965735 inherit pub_methods_classshark_1_1_i_serializable" id="r_a4560a94e8f4908fe8627e41e7d965735"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_serializable.html#a4560a94e8f4908fe8627e41e7d965735">BOOST_SERIALIZATION_SPLIT_MEMBER</a> ()</td></tr>
<tr class="separator:a4560a94e8f4908fe8627e41e7d965735 inherit pub_methods_classshark_1_1_i_serializable"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classshark_1_1_i_parameterizable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classshark_1_1_i_parameterizable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classshark_1_1_i_parameterizable.html">shark::IParameterizable&lt; VectorType &gt;</a></td></tr>
<tr class="memitem:a9e3a11172e74d1aa7292f3de4e2b6ebc inherit pub_methods_classshark_1_1_i_parameterizable" id="r_a9e3a11172e74d1aa7292f3de4e2b6ebc"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_i_parameterizable.html#a9e3a11172e74d1aa7292f3de4e2b6ebc">~IParameterizable</a> ()</td></tr>
<tr class="separator:a9e3a11172e74d1aa7292f3de4e2b6ebc inherit pub_methods_classshark_1_1_i_parameterizable"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a>&gt;<br />
class shark::LinearSAGTrainer&lt; InputType, LabelType &gt;</div><p>Stochastic Average Gradient Method for training of linear models,. </p>
<p>Given a differentiable loss function L(f, y) and a model f_j(x)= w_j^Tx+b this trainer solves the regularized risk minimization problem  </p><p class="formulaDsp">
\[
    \min \frac{1}{2} \sum_j \frac{\lambda}{2}\|w_j\|^2 + \frac 1 {\ell} \sum_i L(y_i, f(x_i)),
\]
</p>
<p> where i runs over training data, j over the model outputs, and lambda &gt; 0 is the regularization parameter.</p>
<p>The algorithm uses averaging of the algorithm to obtain a good estimate of the gradient. Averaging is performed by summing over the last gradient value obtained for each data point. At the beginning this estimate is far off as old gradient values are outdated, but as the algorithm converges, this gives linear convergence on strictly convex functions and O(1/T) convergence on not-strictly convex functions.</p>
<p>The algorithm supports classification and regresseion, dense and sparse inputs and weighted and unweighted datasets Reference: Schmidt, Mark, Nicolas Le Roux, and Francis Bach. "Minimizing finite sums with the stochastic average gradient." arXiv preprint arXiv:1309.2388 (2013). </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00091">91</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="aaabdd7fe303dcafb9ec99ffd993286c3" name="aaabdd7fe303dcafb9ec99ffd993286c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaabdd7fe303dcafb9ec99ffd993286c3">&#9670;&#160;</a></span>LossType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef detail::LinearSAGTrainerBase&lt;<a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>,<a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a>&gt;::LossType <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::LossType</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00098">98</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="a33d1c1faf1d83e0eac1506daa718ca04" name="a33d1c1faf1d83e0eac1506daa718ca04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a33d1c1faf1d83e0eac1506daa718ca04">&#9670;&#160;</a></span>ModelType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ad2ad0a52ecd9ac8677df6dbf403b68b4">Base::ModelType</a> <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::ModelType</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00096">96</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="aa6a8809d447e593855a32e6cb3156a64" name="aa6a8809d447e593855a32e6cb3156a64"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6a8809d447e593855a32e6cb3156a64">&#9670;&#160;</a></span>WeightedDatasetType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ab6d74ebe9e01f9eefb70f9eb12738ffe">Base::WeightedDatasetType</a> <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::WeightedDatasetType</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00097">97</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a160c3456f148c696d13aee3a0dcca402" name="a160c3456f148c696d13aee3a0dcca402"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a160c3456f148c696d13aee3a0dcca402">&#9670;&#160;</a></span>LinearSAGTrainer()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::LinearSAGTrainer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aaabdd7fe303dcafb9ec99ffd993286c3">LossType</a> const *&#160;</td>
          <td class="paramname"><em>loss</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>lambda</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>offset</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">loss</td><td>(sub-)differentiable loss function </td></tr>
    <tr><td class="paramname">lambda</td><td>regularization parameter fort wo-norm regularization, 0 by default </td></tr>
    <tr><td class="paramname">offset</td><td>whether to train with offset/bias parameter or not, default is true </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00106">106</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1e95ff06c2b294528f1d2ef394943142" name="a1e95ff06c2b294528f1d2ef394943142"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e95ff06c2b294528f1d2ef394943142">&#9670;&#160;</a></span>epochs()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::epochs </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the number of training epochs. A value of 0 indicates that the default of max(10, dimensionOfData) should be used. </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00125">125</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="aa9cfa27f5a150ef3a701ee208961a838" name="aa9cfa27f5a150ef3a701ee208961a838"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9cfa27f5a150ef3a701ee208961a838">&#9670;&#160;</a></span>lambda()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::lambda </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the value of the regularization parameter lambda. </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00135">135</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#ac3f3baaf33ba5056acf4799b017ea806">shark::LinearSAGTrainer&lt; InputType, LabelType &gt;::setLambda()</a>.</p>

</div>
</div>
<a id="a14d282d2649ff7d489730833f147b2d3" name="a14d282d2649ff7d489730833f147b2d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14d282d2649ff7d489730833f147b2d3">&#9670;&#160;</a></span>name()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::name </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>From <a class="el" href="classshark_1_1_i_nameable.html" title="This class is an interface for all objects which can have a name.">INameable</a>: return the class name. </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_i_nameable.html#a9893f99314de30cd472e649c235d0db4">shark::INameable</a>.</p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00114">114</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="aa424454e6433505b2ecb93c223ae43bf" name="aa424454e6433505b2ecb93c223ae43bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa424454e6433505b2ecb93c223ae43bf">&#9670;&#160;</a></span>numberOfParameters()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::numberOfParameters </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the number of hyper-parameters. </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_i_parameterizable.html#aed1e8d1d4dbde387e2f6a25141ed3a20">shark::IParameterizable&lt; VectorType &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00164">164</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="aa2f194a2bf0013a85e567c3802391837" name="aa2f194a2bf0013a85e567c3802391837"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2f194a2bf0013a85e567c3802391837">&#9670;&#160;</a></span>parameterVector()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">RealVector <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::parameterVector </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns the vector of hyper-parameters(same as lambda) </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_i_parameterizable.html#afaa2ba692ab64a0edbff60d7ee6794db">shark::IParameterizable&lt; VectorType &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00151">151</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="aadca064196d92cac8b8f23f210ce89c9" name="aadca064196d92cac8b8f23f210ce89c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadca064196d92cac8b8f23f210ce89c9">&#9670;&#160;</a></span>setEpochs()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::setEpochs </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the number of training epochs. A value of 0 indicates that the default of max(10, dimensionOfData) should be used. </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00130">130</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="logistic__regression___s_a_g_8cpp.html#af86d7c9886488dc99c56ffe6e320d549">run()</a>.</p>

</div>
</div>
<a id="ac3f3baaf33ba5056acf4799b017ea806" name="ac3f3baaf33ba5056acf4799b017ea806"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac3f3baaf33ba5056acf4799b017ea806">&#9670;&#160;</a></span>setLambda()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::setLambda </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>lambda</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the value of the regularization parameter lambda. </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00139">139</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

<p class="reference">References <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa9cfa27f5a150ef3a701ee208961a838">shark::LinearSAGTrainer&lt; InputType, LabelType &gt;::lambda()</a>.</p>

</div>
</div>
<a id="aebbf0decaa38e3fc73a13221ec3f4a9b" name="aebbf0decaa38e3fc73a13221ec3f4a9b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebbf0decaa38e3fc73a13221ec3f4a9b">&#9670;&#160;</a></span>setParameterVector()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::setParameterVector </td>
          <td>(</td>
          <td class="paramtype">RealVector const &amp;&#160;</td>
          <td class="paramname"><em>newParameters</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets the vector of hyper-parameters(same as lambda) </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_i_parameterizable.html#ad5e35d1a10ff36fa72ea787baa40e9ad">shark::IParameterizable&lt; VectorType &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00157">157</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

<p class="reference">References <a class="el" href="_exception_8h.html#a42a6a50e4d06c00d60fbca5333f40768">SIZE_CHECK</a>.</p>

</div>
</div>
<a id="a5cbb50a1b75f57c7dc0fe89eb28b159b" name="a5cbb50a1b75f57c7dc0fe89eb28b159b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cbb50a1b75f57c7dc0fe89eb28b159b">&#9670;&#160;</a></span>setTrainOffset()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::setTrainOffset </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>offset</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sets whether the model to be trained should include an offset term. </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00147">147</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<a id="a9e5711480e4f1e214ff3c30a9604d10a" name="a9e5711480e4f1e214ff3c30a9604d10a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e5711480e4f1e214ff3c30a9604d10a">&#9670;&#160;</a></span>train() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classshark_1_1_abstract_weighted_trainer.html">shark::AbstractWeightedTrainer</a>&lt; Model, LabelTypeT &gt;::train </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a> &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8c8370c0d2c2550a50df4d6b0bccf42b">DatasetType</a> const &amp;&#160;</td>
          <td class="paramname"><em>dataset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Executes the algorithm and trains a model on the given unweighted data. </p>
<p>This method behaves as using train with a weighted dataset where all weights are equal. The default implementation just creates such a dataset and executes the weighted version of the algorithm. </p>

<p>Reimplemented from <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a9e5711480e4f1e214ff3c30a9604d10a">shark::AbstractWeightedTrainer&lt; Model, LabelTypeT &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_abstract_weighted_trainer_8h_source.html#l00080">80</a> of file <a class="el" href="_abstract_weighted_trainer_8h_source.html">AbstractWeightedTrainer.h</a>.</p>

</div>
</div>
<a id="a6de6309b709e74361bce1b2ab83f47c6" name="a6de6309b709e74361bce1b2ab83f47c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6de6309b709e74361bce1b2ab83f47c6">&#9670;&#160;</a></span>train() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::train </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a> &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa6a8809d447e593855a32e6cb3156a64">WeightedDatasetType</a> const &amp;&#160;</td>
          <td class="paramname"><em>dataset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Executes the algorithm and trains a model on the given weighted data. </p>

<p>Implements <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ad35ae0b236c45b73f749285a54288e89">shark::AbstractWeightedTrainer&lt; Model, LabelTypeT &gt;</a>.</p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00118">118</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

<p class="reference">References <a class="el" href="namespaceshark_1_1random.html#ab5c1547eee483974d008d43f621a2234">shark::random::globalRng</a>.</p>

<p class="reference">Referenced by <a class="el" href="logistic__regression___s_a_g_8cpp.html#af86d7c9886488dc99c56ffe6e320d549">run()</a>.</p>

</div>
</div>
<a id="ad35ae0b236c45b73f749285a54288e89" name="ad35ae0b236c45b73f749285a54288e89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad35ae0b236c45b73f749285a54288e89">&#9670;&#160;</a></span>train() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classshark_1_1_abstract_weighted_trainer.html">shark::AbstractWeightedTrainer</a>&lt; Model, LabelTypeT &gt;::train </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#a33d1c1faf1d83e0eac1506daa718ca04">ModelType</a> &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_linear_s_a_g_trainer.html#aa6a8809d447e593855a32e6cb3156a64">WeightedDatasetType</a> const &amp;&#160;</td>
          <td class="paramname"><em>dataset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Executes the algorithm and trains a model on the given weighted data. </p>

<p>Implements <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#ad35ae0b236c45b73f749285a54288e89">shark::AbstractWeightedTrainer&lt; Model, LabelTypeT &gt;</a>.</p>

</div>
</div>
<a id="a68fcdf51001257ed05a67d42d2671c10" name="a68fcdf51001257ed05a67d42d2671c10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a68fcdf51001257ed05a67d42d2671c10">&#9670;&#160;</a></span>trainOffset()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a> , class <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classshark_1_1_linear_s_a_g_trainer.html">shark::LinearSAGTrainer</a>&lt; <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a11e51b154b87ed5e33b6ce2c830cd3d6">InputType</a>, <a class="el" href="classshark_1_1_abstract_weighted_trainer.html#a8cc4b95c06687c88b75ea8db8187336d">LabelType</a> &gt;::trainOffset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check whether the model to be trained should include an offset term. </p>

<p class="definition">Definition at line <a class="el" href="_linear_s_a_g_trainer_8h_source.html#l00143">143</a> of file <a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/Algorithms/Trainers/<a class="el" href="_linear_s_a_g_trainer_8h_source.html">LinearSAGTrainer.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
